package com.qfedu.knowledge.controller;

import com.qfedu.knowledge.entity.dto.BasePageDTO;
import com.qfedu.knowledge.entity.vo.ResultVO;
import com.qfedu.knowledge.service.ElasticSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ElasticSearchController
 * @Author ykx
 * @Date 2024/5/22 23:22
 * @Version 1.0
 */
@RestController
@RequestMapping("/knowledge")
public class ElasticSearchController {

    @Autowired
    private ElasticSearchService elasticSearchService;

    @GetMapping("/getQuestionFromES")
    public ResultVO getQuestionFromES(BasePageDTO basePageDTO, String keyword) {
        return ResultVO.success(elasticSearchService.getQuestionFromES(basePageDTO, keyword));
    }

}
